Skip to content

[DEE] Add hardware thresholds to determine if a MDEEStripHit was a NearestNeighbor or not - #190

Draft
fhagemann wants to merge 9 commits into
cositools:develop/emfrom
fhagemann:feature/dee-thresholds
Draft

[DEE] Add hardware thresholds to determine if a MDEEStripHit was a NearestNeighbor or not#190
fhagemann wants to merge 9 commits into
cositools:develop/emfrom
fhagemann:feature/dee-thresholds

Conversation

@fhagemann

Copy link
Copy Markdown

Currently, MSubModuleChargeTransport generates up to three MDEEStripHits for each the HV and LV side, namely for the strip in which the original simulated hit took place, and the two adjacent strips. This part of the DEE does not know if a MDEEStripHit will end up triggering, becoming a NN strip hit, or not being read out at all.

In MSubModuleStripReadout, we apply what I call a "hardware threshold", which is a strip-specific energy threshold in ADC units to determine if a strip triggered or not. The current logic is:

  • If a MDEEStripHit exceeds its hardware threshold, then both neighbors should exist and be read out
  • If a MDEEStripHit did not exceed its hardware threshold, it will only be read out (as a NN strip), if at least ONE of the adjacent strips exceeded its hardware threshold.

For this, I had to

  • add a m_IsNearestNeighbor flag to MDEEStripHit
  • write code to read a hardware threshold file (in MModuleEnergyCalibration), and code to apply it (in MSubModuleStripReadout)
  • write a loop to iterate through all MDEEStripHits after the charge-transport simulations to:
    1. find all TriggeredStrips (above hardware threshold), all NeighborCandidateStrips (neighbors of strips above hardware threshold), all DeadStrips (without energy calibration)
    2. remove all strips below hardware threshold that do not have a neighboring TriggeredStrip
    3. create empty (energy = 0, small timing) MDEEStripHits for all NeighborCandidateStrips that were not created during MSubModuleChargeTransport

Here is a sketch to illustrate the logic behind the final loop:

Sketch

@fhagemann fhagemann added the DEE Development related to the detector effects engine label Aug 12, 2026
@fhagemann
fhagemann marked this pull request as draft August 12, 2026 00:13
@fhagemann

Copy link
Copy Markdown
Author

In my last commit, I added a dummy hardware thresholds file, together with a corresponding dummy ecal.
It is important to use the hardware thresholds together with the correct ecal file, as the hardware thresholds in the DEE are applied in ADC units (which requires the conversion from keV -> ADC to be correct).

The "real" hardware threshold files are currently determined using the python tools by:

  • creating energy histograms in ADC units for events with hit_type 0 (triggered)
  • fitting the noise peak to the left of that distribution
  • setting the hardware threshold at the peak position minus the FWHM/2 (half width at half maximum)
strip_hardware_threshold

This, at some point, can be generated using the threshold app in #166.

@fhagemann

Copy link
Copy Markdown
Author

With the changes in this PR, the DEE would require a hardware threshold file, or it wouldn't run.
I could also add the option to "just" pass a value for the hardware threshold instead of a file, so that people can easily set something if they don't care about main strip / NN classification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DEE Development related to the detector effects engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant